home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / ada / gwuada_8.zip / EDIT.H < prev    next >
C/C++ Source or Header  |  1993-05-02  |  5KB  |  198 lines

  1. /*
  2.     GWAda Development Environment for 386/486 PCs   
  3.     Copyright (C) 1993, Arthur Vargas Lopes  & Michael Bliss Feldman
  4.                         vlopes@vortex.ufrgs.br mfeldman@seas.gwu.edu
  5.  
  6.     This program is free software; you can redistribute it and/or modify
  7.     it under the terms of the GNU General Public License as published by
  8.     the Free Software Foundation; version 2 of the License.    
  9.  
  10.     This program is distributed in the hope that it will be useful,
  11.     but WITHOUT ANY WARRANTY; without even the implied warranty of
  12.     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13.     GNU General Public License for more details.
  14.  
  15.     You should have received a copy of the GNU General Public License
  16.     along with this program; if not, write to the Free Software
  17.     Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
  18. */
  19.  
  20. #include <graph.h>
  21.  
  22. #define GWAda_Version       "I.7"
  23. #define AVL_TOOL_FNAME        "avltool.mnu"
  24. #define AVL_TOOL_MAX        550
  25. #define AVL_TOOL_MAX_MENU    35
  26. #define AVL_MAX_UNITS       350
  27. #define AVL_MAX_NAME_SIZE   60
  28. #define AVL_MENU_ITEMS      10
  29. #define AVL_MAX_FILE_NAME   128
  30. #define AVL_MAX_WINDOWS     8
  31. #define AVL_MAX_LINEL       256
  32. #define AVL_MAX_COLORS      16
  33. #define AVL_FN_OPTIONS      "GWAda.opt"
  34. #define AVL_DEFAULT_LIB     "MyLib"
  35. #define AVL_TEXT_COLOR      15  /* White */
  36. #define AVL_TEXT_BK_COLOR   1   /* Blue */
  37. #define AVL_WIND_COLOR      15  /* White */
  38. #define AVL_WIND_BK_COLOR   7   /* Gray */
  39. #define AVL_WIND_TITLE      11  /* Light blue */
  40. #define AVL_QUES_COLOR      1   /* Blue */
  41. #define AVL_QUES_BK_COLOR   7   /* Gray */
  42. #define AVL_PROM_COLOR      15  /* White */
  43. #define AVL_PROM_BK_COLOR   0   /* Black */
  44. #define AVL_MENU_READY      4   /* Red */
  45. #define AVL_MENU_LETTER     1   /* Blue */
  46. #define AVL_MENU_WORD       9   /* light blue */
  47. #define AVL_MENU_BK_COLOR   7   /* Gray */
  48. #define AVL_ERRO_COLOR      4   /* red */
  49. #define AVL_STAT_BK_COLOR   AVL_TEXT_BK_COLOR
  50. #define AVL_STAT_COLOR      11
  51. #define AVL_MESG_COLOR      1
  52. #define AVL_MESG_BK_COLOR   4
  53. #define AVL_NO_COLORS_OPTS  18
  54. #define avl_video_base_address  0xB8000
  55. #define AVL_MAP(r,c)  ((short *) (avl_video_base_address + (r - 1) * 160 + (c - 1) * 2))
  56. #define AVL_PUT(ch,r,c,bk,cor) *AVL_MAP(r,c) = ((char) ch) | ((short) (((bk << 4) | cor) << 8))
  57. #define AVL_ATT(r,c) ((char) ((AVL_MAP(r,c)) >> 8))
  58. #define AVL_CH(r,c)  ((char) *AVL_MAP(r,c))
  59.  
  60.  
  61. typedef    struct {
  62.         char st;
  63.         char name[AVL_MAX_NAME_SIZE + 1];
  64.         } *AVL_BIND_PTR, AVL_BIND_SIZE;
  65.  
  66.  
  67.  
  68. typedef struct {
  69.         char status;
  70.         char is_main;
  71.         char cdate[5];
  72.         char fu[AVL_MAX_NAME_SIZE + 1];
  73.         } AVL_UNIT_DATA;
  74.  
  75. typedef struct {
  76.     AVL_UNIT_DATA s[AVL_MAX_UNITS];
  77.     int ns; 
  78.     } *AVL_UNITDT_PTR, AVL_UNITDT;
  79.  
  80. typedef struct {
  81.     char sources[AVL_MAX_NAME_SIZE + 1];
  82.     char library[AVL_MAX_NAME_SIZE + 1];
  83.     int tabsize;
  84.  
  85.     short avl_heap;
  86.     short avl_pgm_stack;
  87.     short avl_task_stack;
  88.     short avl_scheduller;
  89.     char  avl_trace_opts[6];
  90.         
  91.     short avl_txt_color;
  92.     short avl_txt_bk_color;
  93.     short avl_wnd_color;
  94.     short avl_wnd_title;
  95.     short avl_wnd_bk_color;
  96.     short avl_que_color;
  97.     short avl_que_bk_color;
  98.     short avl_pro_color;
  99.     short avl_pro_bk_color;
  100.     short avl_men_ready;
  101.     short avl_men_letter;
  102.     short avl_men_word;
  103.     short avl_men_bk_color;
  104.     short avl_err_color;
  105.     short avl_sta_color;
  106.     short avl_sta_bk_color;
  107.     short avl_msg_color;
  108.     short avl_msg_bk_color;
  109.     } AVL_OPTIONS;
  110.  
  111. typedef struct line_node {
  112.     char line[AVL_MAX_LINEL + 1];
  113.     int  line_no;
  114.     char line_attrib;
  115.     struct line_node *previous;
  116.     struct line_node *next;
  117.     } AVL_LINE_SIZE, *AVL_LINE_PTR;
  118.  
  119. typedef struct {
  120.     char video[4000];
  121.     long bk;
  122.     short co;
  123.     short r1, c1, r2, c2;
  124.     struct rccoord pos;
  125.     } AVL_WIN_SIZE, *AVL_WIN_PTR;
  126.  
  127. typedef void (*PROC_NAME)();
  128.  
  129. typedef struct node {
  130.     char file_name[AVL_MAX_FILE_NAME+1];
  131.     long buffer_size;
  132.     short r1, c1,  /*  upper-left corner of window  */
  133.           r2, c2;  /*  lower-right corner of window */
  134.     int txt_col;
  135.     int scr_col;
  136.     int scr_row;
  137.     int offset;
  138.     char no_status;
  139.     char changed;
  140.     int tabsize;
  141.     int no_errors;
  142.     int line_no; /*  where error was found  */
  143.     int txt_pos; /*  where editing and scanning is in  */
  144.     AVL_LINE_PTR head;
  145.     AVL_LINE_PTR current_line;
  146.     char expanded_line[1025];
  147.     char edit_mode;
  148.     AVL_WIN_SIZE sw;
  149.     struct node *avl_w;
  150.     AVL_WIN_PTR avl_win1;
  151.     PROC_NAME fix;
  152.     PROC_NAME insert;
  153.     PROC_NAME options;
  154.     PROC_NAME delete;
  155.     PROC_NAME error;
  156.     struct node *previous, *next;
  157.     }  AVL_EDIT_WINDOW, *AVL_EDIT_WINDOW_PTR;
  158.  
  159. typedef struct {
  160.     short r, c;
  161.     char *tit;
  162.     } AVL_TIT;
  163.  
  164.  
  165. typedef struct {
  166.     short ret_edit;
  167.     char *sm;
  168.     PROC_NAME proc;
  169.     } AVL_SMENU_SEL;
  170.     
  171. typedef struct {
  172.     int r, c;
  173.     AVL_SMENU_SEL s[23];
  174.     } AVL_STIT;
  175.  
  176.  
  177. typedef struct {
  178.     short isbk;
  179.     char *where;
  180.     short *who;
  181.     } AVL_COLOR_CHOICES;
  182.  
  183.  
  184. typedef struct {
  185.     char menu_item[AVL_TOOL_MAX_MENU+1];
  186.     char source[13]; 
  187.     } *AVL_MENU_PTR, AVL_MENU_SIZE;
  188.  
  189. typedef struct {
  190.     AVL_MENU_SIZE menu[AVL_TOOL_MAX];
  191.     int no_menu;
  192.     } *AVL_TOOL_PTR, AVL_TOOL_SIZE;
  193.  
  194. typedef struct {
  195.     char name[AVL_TOOL_MAX][13];
  196.     int no_files;
  197.     } AVL_SOURCE_SIZE, *AVL_SOURCE_PTR;
  198.